package cn.kgc.crowdfundingadminspringboot2.pojo;

import java.util.ArrayList;
import java.util.List;

public class Tag {
    private Integer id;

    private Integer pid;

    private String name;


    // 当前节点的子节点集合，设置默认值是为了避免组装节点时空指针异常
    private List<Tag> children = new ArrayList<>();

    // 控制节点展开还是折叠，设置为true是让整个树形菜单默认展开
    private Boolean open = true;

    public List<Tag> getChildren() {
        return children;
    }

    public void setChildren(List<Tag> children) {
        this.children = children;
    }

    public Boolean getOpen() {
        return open;
    }

    public void setOpen(Boolean open) {
        this.open = open;
    }

    @Override
    public String toString() {
        return "Tag{" +
                "id=" + id +
                ", pid=" + pid +
                ", name='" + name + '\'' +
                ", children=" + children +
                ", open=" + open +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getPid() {
        return pid;
    }

    public void setPid(Integer pid) {
        this.pid = pid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }
}